<% @main_header = "#{link_to('Ptrack:', '/')} #{@project.name if @project}: Notes" %>

  <div style="float: left; width: 100%;">
  	<fieldset>
	<legend>All Notes</legend>
	<table>
	<tr>
		<td style="font-weight: bold;">
			Title
		</td>
        <% unless @project %>
		<td style="font-weight: bold;">
			Project
		</td>
        <% end %>

		<td style="font-weight: bold;">
			Contact
		</td>
		<td style="font-weight: bold;">
			Date at Time
		</td>
		<td></td>
		<td></td>
		<td></td>
	</tr>
	<tr>
		<td colspan="7">
			<hr>
		</td>
	</tr>
	<% for note in @notes %>
  	<tr>
    <td><%=h note.title %></td>

  <% unless @project %>
	<td><%=note.project.nil? ? "Project Not Specified" : h(note.project.name) %></td>
  <% end %>

    <td><%=note.contacts.nil? ? "Contact Not Specified" : note.contacts.each{|c| c.full_name } %></td>

	<td><%=note.updated_at.strftime("%d.%m.%Y at %H:%M") %></td>
    <td><%= link_to "Show", :action => "show", :id => note%></td>
	<td><%= link_to "Edit", :action => "edit", :id => note%></td>
	</tr>
 
	<% end %>
	</table>
  	</fieldset>
	<p>
	<%= link_to "Previous page", :action => "index" %>
	</p>
  </div>
